#ifndef _DBI_TESTZJD_H_
#define _DBI_TESTZJD_H_
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <map>
#include <iostream>
#include "ayoo.h"

/**
 * @brief data-storage for testzjd
 * @remarks generated-code.
 */
class Testzjd:public AYOO::BaseRow
{
public:
	uint32_t id;
	std::string name;
	char gender;
	std::string address;
private:
	bool __name_changed;
	bool __gender_changed;
	bool __address_changed;
public:
	Testzjd()
	: AYOO::BaseRow()
	{
		this->id = 0;
		this->name = "";
		this->gender = 0;
		this->address = "";
	}

	~Testzjd()
	{}
	
	void Escape()
	{
		AYOO::MySQLWrap::EscapeString( this->name );
		AYOO::MySQLWrap::EscapeString( this->address );
	}

};


/**
 * @brief data-DBI for testzjd
 * @remarks generated-code.
 */
class DBITestzjd:public AYOO::BaseDBI
{
public:
	DBITestzjd(const std::string &sHost, uint32_t iPort, const std::string &sUser, const std::string &sPswd)
	: AYOO::BaseDBI( sHost, iPort, sUser, sPswd)
	{
	//	LOG_DEB("concrete-init.");
	}

	DBITestzjd(const AYOO::Config& conf)
	: AYOO::BaseDBI(conf, "DB_HOST", "DB_PORT", "DB_USER", "DB_PSWD" )
	{
	}

	int32_t Insert(Testzjd &in_Testzjd);
	int32_t SelectOne(uint32_t id, Testzjd &out_Testzjd);
	int32_t Select(const std::string &sCondition, uint32_t iStart, uint32_t iLimit, std::vector<Testzjd> &outlist_Testzjd);
	int32_t Count(const std::string &sCondition);
	int32_t UpdateOne(Testzjd &in_Testzjd);
	int32_t Update(const std::string &sCondition, Testzjd &in_Testzjd);
	int32_t DeleteOne(uint32_t id);
	int32_t Delete(const std::string &sCondition);
};

#endif /*_DBI_TESTZJD_H_*/

